% deleteRowCol - delete a range consisting of entire rows or columns
%
% Parameters
%   sheet - name of sheet to delete rows or columns from.  If this is
%            unspecified the currently active sheet is used
%   range - range to delete.  Range must be entire rows or columns 
%           (E.g. A:C or 23:45)
% 
% Notes:  Error is generated if the range is missing, or if the specified
%         range is not just rows or just columns
%
% Throws
%   ExcelDoc:deleteRowCol:InvalidSheet
%   ExcelDoc:deleteRowCol:InvalidRange
%
% See also clearSheet


% Auth/Revision: Ouyang Wei
%                $Id: copyInsertRow.m 1353 2021-07-3 15:42:43Z weio $:
%                Copyright 2014, The MathWorks Inc.

function copyInsertRow(obj, sheet, SourceRowRange, DownFlag)
    WorkSheets = obj.workbookHandle.Sheets;
    TargetSheet = get(WorkSheets,'item',sheet);
    Row_original=TargetSheet.Range(SourceRowRange);

    if DownFlag==1
        XIDirection=-4121;
    else
        XIDirection=-4162;
    end
    Row_original.Copy();
    Row_original.Insert(XIDirection);
end
